/* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Security Token Service
Security Token Service API

OpenAPI spec version: v1
Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/

#import <Foundation/Foundation.h>
#import <JDCloudOCSDKSts/StsApiModel.h>


@implementation StsAssumeRoleRequest
-(id) initWithRegion:(NSString *)regionId
assumeRoleInfo:(AssumeRoleInfo*)assumeRoleInfo { 
    self.regionId = regionId;
    self.assumeRoleInfo = assumeRoleInfo;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
assumeRoleInfo:(AssumeRoleInfo*)assumeRoleInfo { 
    self.regionId = regionId;
    self.version = version;
    self.assumeRoleInfo = assumeRoleInfo;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self assumeRoleInfo])
    {
        [result setValue:[[self assumeRoleInfo] dictionary]forKey:@"assumeRoleInfo"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.assumeRoleInfo = [[AssumeRoleInfo alloc]initWithDic:[dictionary objectForKey:@"assumeRoleInfo"]];
    return self;
} 

@end
@implementation StsAssumeRoleResult
-(id) initWithCredentials:(Credentials*) credentials { 
    self.credentials = credentials;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self credentials])
    {
        [result setValue:[[self credentials] dictionary]forKey:@"credentials"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.credentials = [[Credentials alloc]initWithDic:[dictionary objectForKey:@"credentials"]];
    return self;
} 

@end
  
@implementation StsAssumeRoleResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
StsAssumeRoleResult* result = [[StsAssumeRoleResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(StsAssumeRoleResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
 
